package com.ruoyi.loan.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.loan.mapper.TbRefundMapper;
import com.ruoyi.loan.domain.TbRefund;
import com.ruoyi.loan.service.ITbRefundService;

/**
 * 还款方式Service业务层处理
 * 
 * @author jy
 * @date 2023-01-14
 */
@Service
public class TbRefundServiceImpl implements ITbRefundService 
{
    @Autowired
    private TbRefundMapper tbRefundMapper;

    /**
     * 查询还款方式
     * 
     * @param refundId 还款方式主键
     * @return 还款方式
     */
    @Override
    public TbRefund selectTbRefundByRefundId(Long refundId)
    {
        return tbRefundMapper.selectTbRefundByRefundId(refundId);
    }

    /**
     * 查询还款方式列表
     * 
     * @param tbRefund 还款方式
     * @return 还款方式
     */
    @Override
    public List<TbRefund> selectTbRefundList(TbRefund tbRefund)
    {
        return tbRefundMapper.selectTbRefundList(tbRefund);
    }

    /**
     * 新增还款方式
     * 
     * @param tbRefund 还款方式
     * @return 结果
     */
    @Override
    public int insertTbRefund(TbRefund tbRefund)
    {
        tbRefund.setCreateTime(DateUtils.getNowDate());
        return tbRefundMapper.insertTbRefund(tbRefund);
    }

    /**
     * 修改还款方式
     * 
     * @param tbRefund 还款方式
     * @return 结果
     */
    @Override
    public int updateTbRefund(TbRefund tbRefund)
    {
        tbRefund.setUpdateTime(DateUtils.getNowDate());
        return tbRefundMapper.updateTbRefund(tbRefund);
    }

    /**
     * 批量删除还款方式
     * 
     * @param refundIds 需要删除的还款方式主键
     * @return 结果
     */
    @Override
    public int deleteTbRefundByRefundIds(Long[] refundIds)
    {
        return tbRefundMapper.deleteTbRefundByRefundIds(refundIds);
    }

    /**
     * 删除还款方式信息
     * 
     * @param refundId 还款方式主键
     * @return 结果
     */
    @Override
    public int deleteTbRefundByRefundId(Long refundId)
    {
        return tbRefundMapper.deleteTbRefundByRefundId(refundId);
    }
}
